/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.core.persistence.DataEntity;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 应付结算单Entity
 * @author weisong
 * @version 2017-09-18
 */
public class Payable extends DataEntity<Payable> {
	
	private static final long serialVersionUID = 1L;
	public static final int updateStatus1 = 2;		//部分开票
	public static final int updateStatus2 = 3;		//全部开票
	public static final int updateStatus3 = 1;		//已确认
	public static final int updateStatus4 = 4;		//部分核销
	public static final int updateStatus5 = 5;		//全部核销
	public static final int CLOSED = 6;		//已关闭
	private String clearingNo;		// 结算单号
	private Date busyDate;		// 结算日期
	private Integer status;		// 状态
	private Consignor payee;		// 结算方
	private Double clearingMoney;		// 结算金额
	private Double invoiceMoney;		// 开票金额
	private Double vcaMoney;		// 核销金额
	private Double noInvoiceMoney;		// 未开票金额
	private Double noVcaMoney;		// 未核销金额
	private String closeReason;		// 关闭原因
	private String logistics;		// 物流组织

	//非数据库字段 结算单关联的订单（数据源页面直接选择订单生成结算单，没有经过明细）
	private List<PayTip> tips;

	//供查询使用
	private Date startDate;		// 开始时间
	private Date endDate;		// 结束时间
	
	public Payable() {
		super();
	}

	public Payable(String id){
		super(id);
	}

	@ExcelField(title="结算单号", align=2, sort=6)
	public String getClearingNo() {
		return clearingNo;
	}

	public void setClearingNo(String clearingNo) {
		this.clearingNo = clearingNo;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="结算日期不能为空")
	@ExcelField(title="结算日期", align=2, sort=7)
	public Date getBusyDate() {
		return busyDate;
	}

	public void setBusyDate(Date busyDate) {
		this.busyDate = busyDate;
	}
	
	@NotNull(message="状态不能为空")
	@ExcelField(title="状态", dictType="payable_status", align=2, sort=8)
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@ExcelField(title="结算方", align=2, sort=9)
	public Consignor getPayee() {
		return payee;
	}

	public void setPayee(Consignor payee) {
		this.payee = payee;
	}
	
	@NotNull(message="结算金额不能为空")
	@ExcelField(title="结算金额", align=2, sort=10)
	public Double getClearingMoney() {
		return clearingMoney;
	}

	public void setClearingMoney(Double clearingMoney) {
		this.clearingMoney = clearingMoney;
	}
	
	@ExcelField(title="开票金额", align=2, sort=11)
	public Double getInvoiceMoney() {
		return invoiceMoney;
	}

	public void setInvoiceMoney(Double invoiceMoney) {
		this.invoiceMoney = invoiceMoney;
	}
	
	@ExcelField(title="核销金额", align=2, sort=12)
	public Double getVcaMoney() {
		return vcaMoney;
	}

	public void setVcaMoney(Double vcaMoney) {
		this.vcaMoney = vcaMoney;
	}
	
	@ExcelField(title="未开票金额", align=2, sort=13)
	public Double getNoInvoiceMoney() {
		return noInvoiceMoney;
	}

	public void setNoInvoiceMoney(Double noInvoiceMoney) {
		this.noInvoiceMoney = noInvoiceMoney;
	}
	
	@ExcelField(title="未核销金额", align=2, sort=14)
	public Double getNoVcaMoney() {
		return noVcaMoney;
	}

	public void setNoVcaMoney(Double noVcaMoney) {
		this.noVcaMoney = noVcaMoney;
	}
	
	@ExcelField(title="关闭原因", align=2, sort=15)
	public String getCloseReason() {
		return closeReason;
	}

	public void setCloseReason(String closeReason) {
		this.closeReason = closeReason;
	}
	
	@ExcelField(title="物流组织", align=2, sort=16)
	public String getLogistics() {
		return logistics;
	}

	public void setLogistics(String logistics) {
		this.logistics = logistics;
	}

	public List<PayTip> getTips() {
		return tips;
	}

	public void setTips(List<PayTip> tips) {
		this.tips = tips;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
}